<template>
    <div>
        <Breadcrumb></Breadcrumb>
        <el-card>
            <template>
                <el-table :data="tableData" border style="width: 100%">
                    <el-table-column type="index" label="#">
                    </el-table-column>
                    <el-table-column prop="authName" label="权限名称">
                    </el-table-column>
                    <el-table-column prop="path" label="路径">
                    </el-table-column>
                    <el-table-column prop="address" label="权限等级">
                        <template slot-scope="scope">
                            <el-tag v-if="scope.row.level==0" >一级权限</el-tag>
                            <el-tag v-if="scope.row.level==1" type="success">二级权限</el-tag>
                            <el-tag v-if="scope.row.level==2" type="warning">三级权限</el-tag>
                        </template>
                    </el-table-column>
                </el-table>
            </template>
        </el-card>

    </div>
</template>

<script>
import Breadcrumb from '@/views/Breadcrumb.vue'
import { getRight } from '@/utils/Rights'
export default {
    components: { Breadcrumb },
    data() {
        return {
            tableData: []
        }
    },
    methods: {
        async getTableData() {
            let { data: res } = await getRight()
            this.tableData = res.data

            console.log(res);
        }
    },
    mounted(){
        this.getTableData()
    }
}
</script>